package flc.ast.adapter;


import android.view.View;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import flc.ast.bean.MyAlbumBean;
import flc.ast.bean.MySelEditBean;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;

public class SelEditAdapter extends StkProviderMultiAdapter<MySelEditBean> {


    public SelEditAdapter() {
        addItemProvider(new StkSingleSpanProvider(126));
        addItemProvider(new SelEditProvider());
    }

    private class SelEditProvider extends BaseItemProvider<MySelEditBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_sel_edit;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, MySelEditBean bean) {
            baseViewHolder.setText(R.id.tvSelEditItemName, bean.getName());
            if (bean.isSelected()) {
                baseViewHolder.setImageResource(R.id.ivSelEditItemSel, R.drawable.icon_gx2);
            } else {
                baseViewHolder.setImageResource(R.id.ivSelEditItemSel, R.drawable.icon_gx3);
            }
        }
    }

}
